<?php

Yii::import('zii.widgets.CPortlet');

class TagCloud extends CPortlet
{
	
	public $maxTags=20;

	protected function renderContent()
	{
		$tags=Category::model()->findAll();
		
		//print_r($tags);die;

		foreach($tags as $category=>$weight)
		{
			//print_r($weight);echo '-----------';
			$link=CHtml::link($weight->name, array('products/admin','Products[category_id]'=>$weight->id));
			echo CHtml::tag('span', array('class'=>'Products[category_id]'), $link)."<br/>";    
			
		//	echo "<div onclick='javascript:changeCategory(".$weight->id.")',onmousedown='myFunction(this)'>
		 //         <input type='button' vlaue=".$weight->name." style='height=20px;width=80px;'></div>";
		}
	}
}